import {
  IsString,
  IsEnum,
  IsInt,
  IsNotEmpty,
  IsOptional,
  IsArray,
} from 'class-validator';
import { RecordWay, Unit, SetsType } from 'src/types/motion';

export default class PlanMotionDto {
  @IsNotEmpty()
  @IsString()
  motionId: string;

  @IsNotEmpty()
  @IsString()
  uuid: string;

  @IsNotEmpty()
  @IsEnum(RecordWay)
  recordWay: RecordWay;

  @IsNotEmpty()
  @IsEnum(SetsType)
  setsType: SetsType;

  @IsNotEmpty()
  @IsEnum(Unit)
  unit: Unit;

  @IsOptional()
  @IsNotEmpty()
  @IsArray()
  sets?: [number, number][];

  @IsOptional()
  @IsInt()
  innerRest: number;

  @IsOptional()
  @IsInt()
  outerRest: number;
}
